The present invention relates generally to processing of variable gray level images, and more particularly to error diffusion working as a multi-valued gradation reproduction method. The inventive error diffusion is broadly applicable to printers as a single unit, and those copiers, facsimile machines, computer systems, and word processors which include printing functions, and combinations thereof.
The error diffusion is one typical example among various proposed halftone gradation processing approaches for gradation reproduction of variable gray level images. The error diffusion may be used, for example, to view continuous gradation images on a binary display, and to generate bit maps for use with inkjet and laser printers. The error diffusion typically includes the steps of obtaining a position and pixel value (0 through 255) of a target pixel in a 256 gradation input image (which is read out, for example, by a scanner), obtaining an optimal pixel value of the target pixel in an output palette (i.e., an output device of a printer etc.), calculating for the target pixel a difference (i.e., error) between the input image and the optimal pixel value, and adding (i.e., diffusing) a fraction of the error to pixels around the target pixel in the input image.
An optimal pixel value is selected from prefixed thresholds that are inherent to the output device. For example, a three gradation printer has thresholds of 0, 127 and 255. The diffusion (or error) matrix determines how much of error is to be distributed to which surrounding pixel. If a pixel value of the next target pixel (for example, a next pixel on the previous target pixel""s right) is corrected as a result of an addition to a fraction of the error from the previous target pixel, a difference between the corrected pixel value and the optimal pixel value with respect to the target pixel may become an error.
However, the conventional error diffusion always selects the closest threshold to a pixel value of the target pixel, resulting in an output image having a discontinuous part in the gradation reproduction. For example, when a monochromatic gradation image that has experienced the halftone gradation processing according to the conventional error diffusion is output from the aforementioned three-gradation printer, the printing result contains a thick painted portion since the error diffusion outputs only a value of 127 for pixel values close to 127.
Accordingly, it is an exemplified general object of the present invention to provide a novel and useful error diffusion in which the above disadvantages are eliminated.
Another exemplified and more specific object of the present invention is to provide a halftone gradation processing method that eliminates or reduces the discontinuity in the gradation reproduction in comparison with the conventional error diffusion.
In order to achieve the above objects, the halftone gradation processing method of the present invention comprises the steps of obtaining a position and a pixel value of a target pixel in an input image, correcting the pixel value, selecting the closest threshold to the corrected pixel value from among usable thresholds assignable to the pixel value, calculating an error between the corrected pixel value and the selected threshold by utilizing a personal computer, and diffusing the error around the target pixel, the pixel value correcting step being corrected by the diffused error, and the selected threshold being output to an output device which may handle the assigned thresholds.
A computer-readable recording medium according to one aspect of the present invention stores the above halftone gradation processing method. A processing system of the present invention includes such a computer-readable recording medium and a processor that executes the halftone gradation processing method. A recording device of the present invention includes an output part that outputs the input image in accordance with the halftone gradation processing method.
According to the halftone gradation processing method of the present invention, all the thresholds are not always usable but may be prohibited from being used under a predetermined condition, preventing the continuous selection of the same threshold.
Other objects and further features of the present invention will become readily apparent from the following description and accompanying drawings.